package cn.lx.demo;

/**
 * @author lixin
 * @Classname Proxy
 * @Description TODO
 * @Date 2019/10/5 上午10:37
 */
public class Proxy implements Subject {

    // 要代理那个类
    private Subject subject = null;

    public Proxy() {
        this.subject = new Proxy();
    }

    // 通过构造函数传递代理者
    public Proxy(Subject _subject) {
        this.subject = _subject;
    }

    public void request() {
        this.before();
        this.subject.request();
        this.after();
    }


    // 预处理
    public void before() {

    }

    // 后处理
    public void after() {

    }
}
